/* GUI CONVERTED from reupdspt.p (converter v1.76) Thu Apr 25 19:01:06 2002 */
/* reupdspt.p - REPETITIVE (Update spt_det)                                   */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.3.1.2 $                                                       */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 7.3         LAST MODIFIED: 11/10/94   BY: WUG *GO42*             */
/* REVISION: 8.6         LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan      */
/* REVISION: 9.1         LAST MODIFIED: 08/12/00   BY: *N0KP* Mark Brown      */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.3.1.2 $    BY: Jean Miller           DATE: 04/16/02  ECO: *P05H*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

define input parameter sct_recid as recid.

find sct_det where recid(sct_det) = sct_recid no-lock.

for each spt_det where
         spt_site = sct_site and
         spt_sim = sct_sim and
         spt_part = sct_part
exclusive-lock:

   if spt_pct_ll = 1 then
   assign
      spt_cst_tl = sct_mtl_tl
      spt_cst_ll = sct_mtl_ll.

   else
   if spt_pct_ll = 2 then
   assign
      spt_cst_tl = sct_lbr_tl
      spt_cst_ll = sct_lbr_ll.

   else
   if spt_pct_ll = 3 then
   assign
      spt_cst_tl = sct_bdn_tl
      spt_cst_ll = sct_bdn_ll.

   else
   if spt_pct_ll = 4 then
   assign
      spt_cst_tl = sct_ovh_tl
      spt_cst_ll = sct_ovh_ll.

   else
   if spt_pct_ll = 5 then
   assign
      spt_cst_tl = sct_sub_tl
      spt_cst_ll = sct_sub_ll.

   else
   assign
      spt_cst_tl = 0
      spt_cst_ll = 0.

end.
